<?
global $sys;

ini_set('session.bug_compat_warn', 0);
ini_set('session.bug_compat_42', 0);

date_default_timezone_set('Asia/Bangkok');

session_start();

require_once "sql.php";
require_once "admin.php";
require_once "page.php";

$p = $_REQUEST["p"];

$sys['p'] = explode('/', $p);
$sys['isRewrite'] = false;
$sys['host'] = "http://example.com:100/sk";

initialize();

function initialize() {
	global $sys;
}

function dbConnect(){
    require_once 'conn.php';
    return $conn;
}

function curPageURL() {
 $pageURL = 'http';
 if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
 $pageURL .= "://";
 if ($_SERVER["SERVER_PORT"] != "80") {
  $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
 } else {
  $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
 }
 return $pageURL;
}

?>